<?php
final class Controller_Test extends Controller{
    public function Acquiescent(){
        Template::Display('test.html');
    }

    public function Upload(){
        #处理数据。
        $data=array(
            'dataFileName'=>'dataFileValue',
            'dataFileName'=>'dataFileValue',
            'dataFileName'=>'dataFileValue',
            'dataFileName'=>'dataFileValue'
        );
        #上传图片。
        //$up->Set('AutoNamingFunction',function($filename){return date('Y-m-d G:i:s');});
        $up=new Uploader('Picture1','Picture2');
        $up->Size=20481212300*12;
        $up->Path='e:';
        $up->FileExtension=array('gif','jpg','png','bmp');
        $up->Execute();
        switch($up->ErrorCode){
            case Uploader::UPLOAD_ERR_OK:
                $data['Picture']=$up->Filename;
                echo $data['Picture'].'-A';
            break;
            case Uploader::UPLOAD_ERR_NO_FILE:
                exit('请上传文件');
            break;
            case Uploader::UPLOAD_ERR_EXTENSION:
                echo '扩展名不正确';
            break;
            case Uploader::UPLOAD_ERR_CUSTOM_SIZE:
                echo '文件大小不正确';
            break;
            default:
                echo $up->ErrorCode.'-B';
                //echo sprintf('上传失败，请稍候在试。');
                //echo sprintf('上传失败，代码%s，原因%s。',$errorCode,$errorMessage);
            break;
        }
        #插入数据。
        //Database::Insert('news',$data);
    }
}
?>